package cn.jinjie.day09;

import java.util.ArrayList;
import java.util.Collections;
import java.util.function.Consumer;
import java.util.stream.Stream;

public class Test10 {
    public static void main(String[] args) {
        ArrayList<String> manList = new ArrayList<String>();
        Collections.addAll(manList, "周润发", "成龙", "刘德华", "吴京", "周星驰", "李连杰");
        Stream<String> s1 = manList.stream().filter(s -> s.length() == 3).limit(3);
        ArrayList<String> womanList = new ArrayList<String>();
        Collections.addAll(womanList, "林心如", "张曼玉", "林青霞", "柳岩", "林志玲", "王祖贤");
        Stream<String> s2 = womanList.stream().filter(s -> s.startsWith("林")).skip(1);

        Stream<String> s3 = Stream.concat(s1, s2);
        // s3.forEach(new Consumer<String>() {
        //     @Override
        //     public void accept(String s) {
        //         System.out.println(new Actor(s).getName());
        //     }
        // });
        s3.forEach(s -> System.out.println(new Actor(s).getName()));

    }
}
